﻿@model PagingDataSet<GroupEntity>
@{
    Layout = "app-list-2cols";
    Html.IncludeScript("~/Applications/Group/Scripts/jquery.spb.group.js", ResourceRenderPriority.Last);
    User spaceUser = ViewData.Get<User>("spaceUser", null);
    User currentUser = ViewData.Get<User>("currentUser", new User());
    bool identificationTypeVisiable = ViewData.Get<bool>("identificationTypeVisiable", false);
    bool currentUserIsSpaceUser = false;
    if (spaceUser.UserId == currentUser.UserId)
    {
        currentUserIsSpaceUser = true;
    }
    bool isfollowed = currentUser.IsFollowed(spaceUser.UserId);
    
}
@section Aside{
    <div class="tn-box tn-widget tn-widget-content tn-corner-all spb-group-count-box">
        <div class="tn-box-content tn-widget-content tn-corner-all">
            <ul class="spb-group-count tn-helper-clearfix">
                <li class="tn-border-gray tn-border-right"><a href="@SiteUrls.Instance().UserCreatedGroups(spaceUser.UserName)">
                    <strong class="tn-count">@spaceUser.CreatedGroupCount()</strong></a><span>创建的商户</span></li>
                <li><a href="@SiteUrls.Instance().UserJoinedGroups(spaceUser.UserName)"><strong class="tn-count">@spaceUser.JoinedGroupCount()</strong></a><span>加入的商户</span></li>
            </ul>
        </div>
    </div>
    @Html.Action("_TopGroups", "ChannelGroup", new { topNumber = 5, sortBy = SortBy_Group.StageHitTimes, viewName = "_TopGroups_ListForMyGroup" })
}
<div class="tn-box tn-widget tn-widget-content tn-corner-all spb-group-belong">
    <div class="tn-box-content tn-widget-content tn-corner-all">
        <div class="tn-card tn-helper-clearfix">
            @Html.ShowUserAvatar(spaceUser.UserId, avatarSizeType: AvatarSizeType.Medium, navigateTarget: HyperLinkTarget._blank)
            <div class="tn-info">
                <div class="tn-user-name">
                    <div class="tn-actions">
                        @Html.FollowUser(spaceUser.UserId, "收藏")                   
                    </div>
                    <strong><a href="@SiteUrls.Instance().SpaceHome(spaceUser.UserId)" title="@spaceUser.DisplayName" target="_blank">@spaceUser.DisplayName</a></strong>
                    <span class="spb-user-type">               
                       @Html.IdentificationType(spaceUser.UserId)
                    </span>
                </div>
                <div class="tn-user-data">
                    <a href="@SiteUrls.Instance().SpaceHome(spaceUser.UserId)" target="_blank">
                        @if (currentUserIsSpaceUser)
                        {
                            <text>查看我的空间</text>                           
                        }
                        else
                        {
                            <text>查看TA的空间</text>
                        }
                    </a>
                </div>
            </div>
        </div>
        <div class="tn-tabs">
            <ul class="tn-tabs-nav tn-border-gray tn-border-bottom tn-helper-clearfix">
                <li class="tn-widget-content tn-border-gray tn-border-trl tn-tabs-selected"><a  href="@SiteUrls.Instance().UserJoinedGroups(spaceUser.UserName)" title="@spaceUser.UserName">
                    加入的商户</a> </li>
                <li class="tn-widget-content tn-border-gray tn-border-trl"><a  href="@SiteUrls.Instance().UserCreatedGroups(spaceUser.UserName)" title="@spaceUser.UserName">
                    创建的商户</a> </li>
            </ul>
        </div>
        @Html.Partial("_List", Model, new ViewDataDictionary { { "noDataMessage", "目前还没加入商户!" }, { "isGetMore", true } })
    </div>
</div>
